﻿/*
 * @author: wizardc
 */

using DouEditor.Resource.HotFixed;

namespace DouEditor.Resource
{
    /// <summary>
    /// 根据打出的包体和收集的信息导出热更新相关配置
    /// </summary>
    public class BuildStep_HotFixed : BuildStepBase
    {
        protected override void Start()
        {
            var buildStepData = (BuildStepData) _buildStepData;
            
            new CollectResourceManifest().Collect(buildStepData.buildRule, buildStepData.abInfo);
            new CollectHotFixedManifest().Collect(buildStepData.buildRule);
            if (buildStepData.buildRule.copyToStreamingAssets)
            {
                new CopyToStreamingAssets().Copy(buildStepData.buildRule); // 拷贝 AB 包到 StreamingAssets
            }
            if (buildStepData.isContrast)
            {
                new IncrementPack().Build(buildStepData.buildRule);
            }
            else
            {
                new GenVersionFile().Gen(buildStepData.buildRule);
            }
            
            Complete();
        }
    }
}
